<?php

namespace app\model;


class OrganizationModel extends ActionBaseModel
{
    protected $name = 'organization';

    const STATUS_NORMAL = 0; //组织状态正常
    const STATUS_FORBIDDEN = 1; //组织被封禁
    const STATUS_OFF = 2; //组织已注销

    static public function getStatusText(int $intStatus): string
    {
        switch ($intStatus) {
            case self::STATUS_NORMAL:
                return '正常';
            case self::STATUS_FORBIDDEN:
                return '被封禁';
            case self::STATUS_OFF:
                return '已注销';
            default:
                return '未知';
        }
    }

    public function addOrg(array $arrData):bool{
        if (empty($arrData)) {
            return false;
        }
        $arrData['create_time'] = date('Y-m-d H:i:s');

        $intLow = (new self())->insert($arrData);
        if (empty($intLow)) {
            return false;
        }
        return true;
    }

    
}
